<?php

use yii\db\Migration;

/**
 * Class m190123_083806_add_goods_clonum
 */
class m190123_083806_add_goods_clonum extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('goods',"availability_period",$this->integer()->defaultValue(0));
        $this->addCommentOnColumn('goods','availability_period','有效期');
        $this->addColumn('goods',"availability_num",$this->integer()->defaultValue(0));
        $this->addCommentOnColumn('goods','availability_num','有效次数');


    }

    /**
     * {@inheritdoc}friendly_link
     */
    public function safeDown()
    {
//        echo "m190123_083806_add_goods_clonum cannot be reverted.\n";
        $this->dropColumn('goods',"availability_period");
        $this->dropColumn('goods',"availability_num");
        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190123_083806_add_goods_clonum cannot be reverted.\n";

        return false;
    }
    */
}
